package com.ce.pms.occupation.dao.impl;

import java.util.List;

import com.ce.pms.base.dao.impl.PmsBaseDaoImpl;
import com.ce.pms.occupation.dao.IDocumentReceiveSendDao;
import com.ce.pms.occupation.model.DocumentReceiveSendDO;

/**
 * 资料收发DAO实现
 * @author 王浩羽
 *
 */
public class DocumentReceiveSendDaoImpl extends PmsBaseDaoImpl<DocumentReceiveSendDO> implements IDocumentReceiveSendDao
{

	public DocumentReceiveSendDO getDocumentReceiveSendBy(Long identityId)
	{
		StringBuilder hqlBuilder = new StringBuilder();
		hqlBuilder.append("SELECT ").append(" OBJ FROM ").append(DocumentReceiveSendDO.class.getSimpleName())
		.append(" AS OBJ WHERE ").append("OBJ.identityValidate.keyword = ?");
		List<DocumentReceiveSendDO> list = this.createQuery(hqlBuilder.toString(), identityId).list();
		if(list!=null && !list.isEmpty())
		{
			return list.get(0);
		}
		return null;
	}

}
